package com.guzhen.wallpager;

import android.os.Handler;
import android.os.Looper;

import java.util.HashMap;
import java.util.Map;
import java.util.Timer;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;

public  class ThreadUtils {
    private static  int CPU_COUNT = 0;
    private static Handler HANDLER = null;
    private static Map TASK_POOL_MAP = null;
    private static Timer TIMER = null;
    private static  byte TYPE_CACHED = -2;
    private static  byte TYPE_CPU = -8;
    private static  byte TYPE_IO = -4;
    private static  Map TYPE_PRIORITY_POOLS = null;
    private static  byte TYPE_SINGLE = -1;
    private static Executor sDeliver;

    static {
        ThreadUtils.HANDLER = new Handler(Looper.getMainLooper());
        ThreadUtils.TYPE_PRIORITY_POOLS = new HashMap();
        ThreadUtils.TASK_POOL_MAP = new ConcurrentHashMap();
        ThreadUtils.CPU_COUNT = Runtime.getRuntime().availableProcessors();
        ThreadUtils.TIMER = new Timer();
    }


    public static void runOnUiThread(Runnable runnable0) {
//        if(Looper.myLooper() == Looper.getMainLooper()) {
//            runnable0.run();
//            return;
//        }

        ThreadUtils.HANDLER.post(runnable0);
    }
}